package com.lkx.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lkx.dao.UserMapper;
import com.lkx.domain.User;
import com.lkx.service.UserService;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public int update(User model) {
        return userMapper.updateByPrimaryKeySelective(model);
    }

    @Override
    public User loadObjectByid(Long id) {
        if (id == null) {
            return null;
        }
        return userMapper.selectByPrimaryKey(id);
    }

    @Override
    public User selectByLoginId(String loginId) {
        if (loginId == null) {
            return null;
        }
        return userMapper.selectByLoginId(loginId);
    }
}
